package 链表;

/**
 * @author 陈艺博
 * @date 2021-02-18 08:28
 * @description https://leetcode-cn.com/problems/remove-linked-list-elements/
 **/
public class _203_remove_linked_list_elements_移除链表元素 {
    public ListNode removeElements(ListNode head, int val) {
        if (head == null) {
            return head;
        }
        head.next = removeElements(head.next, val);
        return head.val == val ? head.next : head;
    }
}
